<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>贷款产品详情</title>

    <!-- styles here -->
    <link rel="shortcut icon" href="../favicon.ico">
    <link rel="stylesheet" href="../css/Public_CSS.css">
    <link rel="stylesheet" href="../css/mui.min.css">
    <link rel="stylesheet" href="../css/style.css">
</head>

<body>
    <div class="loan-item-page2" id="app">
        <div class="banner">
            <div class="title">
                <h1 v-html="loan.loanName"></h1>
                <span v-html="loan.loanQuota"></span>
                <small>额度</small>
                <i onclick="window.history.back()"></i>
            </div>
            <div class="info">
                <ul>
                    <li>
                        <p>月利率</p>
                        <p v-html="loan.loanRate"></p>
                    </li>
                    <li>
                        <p>抵押</p>
                        <p v-html="loan.loanMort"></p>
                    </li>
                    <li>
                        <p>期限</p>
                        <p v-html="loan.loanTerm"></p>
                    </li>
                </ul>
            </div>
            <div class="tel">
                <p>咨询热线：400-166-8185</p>
            </div>
        </div>

        <div class="loan-wrap">
            <div class="progress">
                <h1 class="loan-title-small">办理流程</h1>
                <ul>
                    <li v-for="item in loan.steps">
                        <img :src="item.stepIcon" :alt="item.stepName">
                        <span v-html="item.stepName"></span>
                    </li>
                </ul>
            </div>
            <div class="advantage">
                <h1 class="loan-title-small">产品优势</h1>
                <ol>
                    <li v-for="text in texts" v-html="text"></li>
                </ol>
            </div>

            <div class="advantage">
                <h1 class="loan-title-small">申请条件</h1>
                <ol>
                    <li v-for="text in con" v-html="text"></li>
                </ol>
            </div>
            <div class="advantage">
                <h1 class="loan-title-small">所需资料</h1>
                <ol>
                    <li v-for="text in mater" v-html="text"></li>
                </ol>
            </div>
            <div class="next">
                <a @click="apply" class="btn btn-red">我要申请</a>
            </div>
        </div>

        <p>&nbsp;</p>

    </div>

    <!-- scripts here -->
    <script src="../js/common.js" type="text/javascript"></script>
    <script src="../js/jquery.min.js" type="text/javascript"></script>
    <script src="../js/vue.min.js" type="text/javascript"></script>
    <script type="text/javascript" src="../../public/js/loan/mui.min.js"></script>
    <script>
        $(function () {
            vm.loadInfo();
        });
        var vm = new Vue({
            el: "#app",
            data: {
                loan: {
                    steps: []
                },
                texts: [],
                con: [],
                mater: []
            },
            methods: {
                loadInfo: function () {
                    var loanId = GetQueryString("loanId");
                    if (loanId == null || loanId == undefined) {
                        mui.alert("环境异常");
                        return;
                    }
                    $.ajax({
                        url: '/thmlfApi/avs/yb/loanInfo/' + loanId,
                        dataType: "JSON",
                        success: function (r) {
                            if (r.code == 200) {
                                vm.loan = r.result;
                                vm.texts = r.result.loanAdv.split('##');
                                vm.con = r.result.loanApplyCon.split('##');
                                vm.mater = r.result.loanMater.split('##');
                            } else
                                alert(r.message);
                        },
                        error: function (e) {
                            console.log("request error", e);
                            mui.alert("请求失败，请稍后重试");
                        }
                    });
                },
                apply: function () {
                    var loanId = vm.loan.loanId;
                    if (loanId == null || loanId == undefined) {
                        mui.alert("环境异常");
                        return;
                    }
                    window.location.href = "apply.html?loanId=" + loanId;
                }
            }
        });
    </script>

</body>

</html>